
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * @module
 * @author: hjava
 * @since: 2017/2/7 14:31
 */
var typeChecker_1 = __webpack_require__(/*! _util/typeChecker */ "./src/core/utils/typeChecker.ts");
var DeviceInfo = /** @class */ (function () {
    function DeviceInfo() {
        this.deviceType = 2;
        this._hasNetwork = true;
    }
    DeviceInfo.prototype.setHasNetwork = function (hasNetwork) {
        this._hasNetwork = hasNetwork;
    };
    DeviceInfo.prototype.isHasNetwork = function () {
        return this._hasNetwork;
    };
    DeviceInfo.prototype.setDeviceType = function (deviceType) {
        if (!typeChecker_1.default.isNumber(deviceType)) {
            this.deviceType = parseInt(deviceType);
        }
        // 兼容parseInt值为NaN的问题，因为NaN!==NaN
        if (isNaN(deviceType) || (deviceType !== 2 && deviceType !== 4)) {
            this.deviceType = 2;
            return;
        }
        this.deviceType = deviceType;
    };
    return DeviceInfo;
}());
exports.default = new DeviceInfo();


//# sourceURL=webpack://MTDX/./src/core/utils/deviceInfo.ts?